package com.wu.store.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Id;
import java.util.Date;

@Data
public class User {
	@Id
	private Long id;
	private String username;
	@JsonIgnore
	private String password;
	private Integer gender;
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
	private Date birthday;
	private String email;
	private String phone;
	private String province;
	private String city;
	private String area;
	private String address;
	private int isAvailable;
	private int role;
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:SS", timezone = "GMT+8")
	@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
	private Date createTime;
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:SS", timezone = "GMT+8")
	@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
	private Date updateTime;

	@JsonIgnore
	private String source = "local";
	@JsonIgnore
	private String authId;
	private String avatar;
	@JsonIgnore
	private String userInfo;
}
